class Solution:
  def hammingWeight(self, n: int) -> int:
    count = 0
    while n != 0:
      if n % 2 == 1:
        count = count + 1
      n = n // 2
    return count


'''
STATUS: SOLVED
TRIES:  1
TIME:   36 MS
MEMORY: 13.6 MB
'''
if __name__ == "__main__":
  solution = Solution()
  print(solution.hammingWeight(2147483646))